# Makefile for dynamic module loading

APP = test
CC = g++
LD = ld

all: $(APP)

dynamic.o: dynamic.cpp
	$(CC) -fPIC -c dynamic.cpp

dynamic.so: dynamic.o
	$(LD) -shared -o dynamic.so dynamic.o

$(APP): dynamic.so main.cpp
	$(CC) -o $(APP) main.cpp -ldl

clean:
	@rm -f *.o *.so $(APP)
